package ru.tulupov.scheduledrunner.command.impl;

import ru.tulupov.scheduledrunner.Runner;
import ru.tulupov.scheduledrunner.command.Command;
import ru.tulupov.scheduledrunner.command.CommandAnnotation;
import ru.tulupov.scheduledrunner.command.Context;

@CommandAnnotation(name = "run")
public class RunCommand extends Command {

	@Override
	public void execute(Context context) {
		if (args.length < 1) {
			throw new RuntimeException();
		}
		Runner runner = new Runner(args[0]);
		context.getThreadPool().execute(runner);
	}

}
